//import js
//ajax 
var http_request = false;
function sendRequest(url,callBack,isAsy) {
	http_request = false;
		
	if(window.XMLHttpRequest) { 
		http_request = new XMLHttpRequest();
		if (http_request.overrideMimeType) {
			http_request.overrideMimeType("text/xml");
		}
	}
	else if (window.ActiveXObject) { 
		try {
			http_request = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				http_request = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {}
		}
	}
	if (!http_request) { 
		window.alert("Canot create XMLHttpRequest.");
		return false;
	}
	http_request.onreadystatechange = function(){
		if (http_request.readyState == 4) { 
			if (http_request.status == 200) { 
				window.execScript(callBack);
			} else { 
				alert("error");
			}
		}
	}		
	http_request.open("GET", url, isAsy);
	http_request.send(null);
}

var joke_request = false;
function sendJokeRequest(url,callBack,isAsy) {
	joke_request = false;
		
	if(window.XMLHttpRequest) { 
		joke_request = new XMLHttpRequest();
		if (joke_request.overrideMimeType) {
			joke_request.overrideMimeType("text/xml");
		}
	}
	else if (window.ActiveXObject) { 
		try {
			joke_request = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				joke_request = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {}
		}
	}
	if (!joke_request) { 
		window.alert("Canot create XMLHttpRequest.");
		return false;
	}
	joke_request.onreadystatechange = function(){
		if (joke_request.readyState == 4) { 
			if (joke_request.status == 200) { 
				window.execScript(callBack);
			} else { 
				alert("error");
			}
		}
	}		
	joke_request.open("GET", url, isAsy);
	joke_request.send(null);
}
//ajax post
var xml_request = false;
function sendRequestMore(url,param,callBack) {
	xml_request = false;
	if(window.XMLHttpRequest) { 
		xml_request = new XMLHttpRequest();
		if (xml_request.overrideMimeType) {
			xml_request.overrideMimeType("text/xml");
		}
	}
	else if (window.ActiveXObject) { 
		try {
			xml_request = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				xml_request = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {}
		}
	}
	if (!xml_request) { 
		window.alert("Canot create XMLHttpRequest.");
		return false;
	}
	xml_request.onreadystatechange = function(){
		if (xml_request.readyState == 4) { 
			if (xml_request.status == 200) { 
				window.execScript(callBack);
			} else { 
				alert("error");
			}
		}
	}		
	var xml_dom = createXMLDom();
	xml_dom.loadXML('<?xml version="1.0" encoding="gbk"?><xmldata>'+ param + '</xmldata>');
	xml_request.open("POST",url,true);
	xml_request.send(xml_dom);
}
function createXMLDom()
{
	var signatures = ["Msxml2.DOMDocument.5.0",
					  "Msxml2.DOMDocument.4.0",
					  "Msxml2.DOMDocument.3.0",
					  "Msxml2.DOMDocument",
					  "Microsoft.XmlDom"];
	for(var k = 0; k < signatures.length; k++){
		try{
			var domDoc = new ActiveXObject(signatures[k]);
			return domDoc;
		}catch(ee){
		}
	}
	return null;
}
   